package com.paw.core.config;

import com.paw.core.intercepter.TraceInterceptor;
import com.paw.core.intercepter.UserInfoInterceptor;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Rubble
 * @date 2021/8/27
 **/
@Order(value = 1)
public class WebConfiguration implements WebMvcConfigurer {


  @Override
  public void addInterceptors (InterceptorRegistry registry) {
    registry.addInterceptor(new TraceInterceptor()).addPathPatterns("/api/**");
    registry.addInterceptor(new UserInfoInterceptor()).addPathPatterns("/api/**");
  }
}
